<div class="layui-row layui-col-space10">
    <div class="layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">
                {{ __('backup.base') }}
            </div>
            <div class="layui-card-body">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            {{ __('backup.storage_duration') }}
                        </label>
                        <div class="layui-input-block">
                            <input type="number"
                                   name="storage_day"
                                   max="100000"
                                   value="{{ setting.storage_day|default('90') }}"
                                   class="layui-input">
                            <div class="layui-word-aux">
                                {{ __('backup.storage_duration_tip') }}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{{ __('backup.max_memory') }}</label>
                        <div class="layui-input-block">
                            <input type="text"
                                   name="memory_limit"
                                   value="{{ setting.memory_limit|default('128M') }}"
                                   class="layui-input">
                            <div class="layui-word-aux">
                                {{ __('backup.max_memory_tip') }}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{{ __('backup.chunk') }}</label>
                        <div class="layui-input-block">
                            <input type="number"
                                   name="length"
                                   max="10000"
                                   value="{{ setting.length|default('2000') }}"
                                   class="layui-input">
                            <div class="layui-word-aux">
                                {{ __('backup.chunk_tip') }}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{{ __('backup.zip') }}</label>
                        <div class="layui-input-block">
                            <input type="radio" name="zip" value="0" title="{{ __('switch.no') }}"
                                   {% if setting.zip == '0' %}checked{% endif %}
                            >
                            <input type="radio" name="zip" value="1" title="{{ __('switch.yes') }}"
                                   {% if setting.zip == '1' %}checked{% endif %}
                            >
                            <div class="layui-word-aux">
                                {{ __('backup.zip_tip') }}
                            </div>
                            <div class="layui-word-aux">
                                {% if zip %}
                                    {{ __('backup.zip_install') }}
                                {% else %}
                                    {{ __('backup.zip_un_install') }}
                                {% endif %}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{{ __('backup.receive') }}</label>
                        <div class="layui-input-block">
                                        <textarea class="layui-textarea"
                                                  name="receive_email">{{ setting.receive_email }}</textarea>
                            <div class="layui-word-aux">
                                {{ __('backup.receive_tip') }}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"> {{ __('backup.tables') }}</label>
                        <div class="layui-input-block">
                            {% for table in tables %}
                                <input type="checkbox"
                                       class="layui-input"
                                       title="{{ table }}"
                                       disabled
                                       checked
                                >
                            {% endfor %}
                            <div class="layui-word-aux">
                                {{ __('backup.tables_tip') }}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"></label>
                        <button type="button" class="layui-btn layui-btn-normal layui-btn-sm"
                                lay-submit
                                lay-filter="database">
                            {{ __('btn.save') }}
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">
                {{ __('backup.intro') }}
            </div>
            <div class="layui-card-body">
                <div class="layui-text" style="padding: 16px;">
                    <ol>
                        <li>{{ __('backup.explain_support_db') }}</li>
                        <li>{{ __('backup.explain_tip') }}</li>
                        <li>{{ __('backup.explain_suggest1') }}</li>
                        <li>{{ __('backup.explain_suggest2') }}</li>
                        <li>{{ __('backup.explain_suggest3') }}</li>
                        {% if see_config('database')['command'] %}
                            <li>
                                {{ __('backup.explain_command') }}：
                                <br/>
                                {{ see_config('database')['command'] }}
                            </li>
                        {% endif %}
                    </ol>
                </div>
                {% if see_config('database')['command'] %}
                    <fieldset class="layui-elem-field layui-field-title">
                        <legend> {{ __('backup.explain_cron_task') }}</legend>
                    </fieldset>
                    <pre class="layui-code cron-code" lay-options="{theme: 'dark'}">
# {{ __('backup.explain_cron_tip') }}
2 * * * * cd $root_path &&  {{ see_config('database')['command'] }}
</pre>
                {% endif %}
            </div>
        </div>
    </div>
</div>